package com.elvin.platform.beans;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户
 */
@TableName("user")
public class User extends Model<User> {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;//id
    private String nickName;//昵称
    private String telephone;//电话
    private String userName;//用户名
    @JsonIgnore
    private String password;//密码
    private String openid;//用户openid
    private String avatarUrl;//用户头像url
    private String email;//电子邮箱
    @ApiModelProperty(value = "登陆时间", required =false,hidden=true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date loginTime;//最近登陆时间
    @ApiModelProperty(value = "创建时间", required =false,hidden=true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date createTime;//创建日期
    private String  roleId;//角色ID（一用户多角色，之间用逗号隔开）
    //private Long organizeId;//组织id
    private String  scenariosId;//场景ID（一用户多场景，之间用逗号隔开）
    private String  deviceTypeId;//设备ID（一用户多设备，之间用逗号隔开）


  public String getScenariosId() {
    return scenariosId;
  }

  public void setScenariosId(String scenariosId) {
    this.scenariosId = scenariosId;
  }

  public String getDeviceTypeId() {
    return deviceTypeId;
  }

  public void setDeviceTypeId(String deviceTypeId) {
    this.deviceTypeId = deviceTypeId;
  }

  public Long getId() {
        return id;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", nickName='" + nickName + '\'' +
                ", telephone='" + telephone + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", openid='" + openid + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", email='" + email + '\'' +
                ", loginTime=" + loginTime +
                ", createTime=" + createTime +
                ", roleId='" + roleId + '\'' +
                '}';
    }
}
